
package common;

public class ShouldRentAttributeTag extends ItemAttributeTag {

  protected String createText() {
    ShouldRentDetail rent = (ShouldRentDetail) item;

    if ((attribute == null) ||
        (attribute.equalsIgnoreCase("SectionName"))) {
      return (rent.getSectionName());
    } else if (attribute.equalsIgnoreCase("Section")) {
      return (rent.getSection());
    } else if (attribute.equalsIgnoreCase("building")) {
      return (rent.getBuilding());  
    } else if (attribute.equalsIgnoreCase("room")) {
      return (rent.getRoom());
    } else if (attribute.equalsIgnoreCase("customers")) {
      return (rent.getCustomers());    
    } else if (attribute.equalsIgnoreCase("Year")) {
      return (String.valueOf(rent.getYear()));    
    } else if (attribute.equalsIgnoreCase("month")) {
      return (String.valueOf(rent.getMonth()));    
    } else if (attribute.equalsIgnoreCase("id")) {
      return (String.valueOf(rent.getId())); 
    } else if (attribute.equalsIgnoreCase("rent")) {
      return (String.valueOf(rent.getMoney()));
    } else if (attribute.equalsIgnoreCase("handler")) {
      return (rent.getHandler());
    } else if (attribute.equalsIgnoreCase("handledate")) {
      return (rent.getHandleDate().substring(0,10));  
    } else if (attribute.equalsIgnoreCase("anchor")) {
      return (rent.getAnchor());       
    } else return(null);
  }
}
